package com.breeze.blockchain.service;

import static com.breeze.blockchain.common.exception.BizErrorCode.USER_ROLE_NOT_EXIST;

import com.breeze.blockchain.mybatis.entity.RoleDo;
import com.breeze.components.core.exception.ApiException;
import com.mybatisflex.core.service.IService;

/**
 * 角色 服务层。
 *
 * @author breeze
 * @since 2024-05-11 23:21:51
 */
public interface RoleService extends IService<RoleDo> {

  default RoleDo getExistRoleById(Long roleId) {
    return this.getByIdOpt(roleId).orElseThrow(() -> new ApiException(USER_ROLE_NOT_EXIST));
  }
}
